The present invention relates to a debugger for support of the debugging of a program, an array data displaying method in the debugger, and a recording medium having an array data displaying program in the debugger, and more particularly to the debugging of a program with which array data is saved and displayed and the debugging of a multi-process program with which an array distributed to each process is constructed and displayed.
In the prior art of the debugging of a program, means for saving array data referred to a method in which after a sentence or statement for writing array data into a memory such as a file is inserted into a source, a program is re-executed so that the array data is saved. Also, there is a method in which the reference to array data is made without changing a source, that is, a method in which a debugger is used so that array data at the present point of time is displayed at a breakpoint while a program is executed. Further, there is the case where an OS is constructed so that a memory dump is outputted at the time of abnormal completion of a program. The contents of the memory dump can be saved as a dump file. Array data is displayed by passing the dump file through a debugger.
However, the above-mentioned prior art has the following problems. Namely, the saving of array data into a memory such as a file requires that a statement for writing array data into the memory should be inserted into a source. This is accompanied with a danger that an erroneous source change may be made when the statement is inserted at the time of debugging and when it is deleted after debugging. In the method in which a debugger is used with no source change, the debugging is possible only in the case where a program is executed or in the case where a program is abnormally completed. In particular, for a program such as a structure analysis program requiring a long executing time, it is difficult of repeated execution and a problem arises in the aspect of debugging efficiency. Further, the conventional debugger is capable of only the reference to array data at the present breakpoint (or at a point of time of progression of a program which is being executed) and is not provided with means for saving the array data. Therefore, it is not possible to refer to array data at the time of break or interruption before the present breakpoint. In particular, it is difficult to compare the previous contents and the present contents. Also, in the case where a memory dump is outputted, a large amount of data other than a desired array exists and hence the saving of such data causes a problem in the aspect of resource. Further, since the memory dump is outputted only when a program is abnormally completed, this method is unavailable in the case where the program is normally completed.
In the prior art of the debugging of a program distributed to a plurality of processes, means for referring to the whole of a distributed array includes a method in which the distributed array data is displayed as separate arrays corresponding to the respective processes. Also, means for constructing an array distributed to a plurality of programs into an array before distribution includes a method in which a program to be debugged is once completed following the writing of array data of each process into a memory such as a file, and a program for constructing the array data written in the memory into one array is peculiarly generated by a user so that the array data is constructed into an array before distribution and the constructed array is displayed. Further, a method of displaying the values of elements in an array of a single process or in distributional arrays includes a method in which the values of all elements in a designated array(s) are displayed in the form of a text or in the form of a graph.
However, such prior art has the following problems. Namely, since array data distributed to a plurality of processes is capable of only the reference to as separate arrays, there is a problem that it is not possible to grasp the whole of the distributed array at once. Also, the system for constructing distributional arrays into one array through the generation of another program requires that a program to be debugged should be completed once. Therefore, this system has a problem that the efficiency of debugging is poor. Further, in the case where a large amount of data is to be displayed in the form of a graph, the display of all array data in a display screen area or display window makes the displaying rate low. In this case, there is a problem that it is not possible to display all data in one display screen area.
A first object of the present invention is to provide the debugging of a program with which the contents of array data at a desired row in the program are saved into a file without changing a source and the saved array data is displayed on occasion. A second object of the present invention is to provide the debugging of a multi-process program (or parallel program) with which the efficiency of debugging is improved by automatically constructing a distributed array at a desired row in a program to be debugged and displaying the constructed array in the form of a graph at a high speed.
To attain the first object of the present invention, data saving means for saving the contents of array data at a breakpoint into a file for the saving of array data (hereinafter referred to as array data save file) in time series is provided in a debugger system. Thereby, the saving of any array data at any breakpoint is possible irrespective of whether the program is normally completed or abnormally completed. Also, the saving of a resource as compared with the case of a memory dump is possible since unnecessary information is removed so that only any necessary array data can be saved.
To attain the first object, data displaying means for fetching the saved array data from the array data save file and displaying it on occasion may be provided in the debugger system. The data displaying means is operated as a process separated from and asynchronously with the data saving means to enable the occasional display under program execution or after the completion of program execution. With this construction, the previously displayed array can be displayed on occasion under program execution, thereby improving the efficiency of debugging. Also, array data sampled at the time of program execution can be displayed on occasion after the completion of program execution, thereby improving the efficiency of debugging.
To attain the first object, selecting means for facilitating the selection of an array to be displayed from an array name, a sampling instant of time and/or the like for the saved array data and facilitating maintenance including the deletion, copy and/or the like of the saved array data may be provided in the data displaying means. With the provision of the selecting means, the display of array data can be performed in such a manner that desired array data can easily be selected. Also, the maintenance including the deletion, copy and/or the like of the saved array data can be facilitated. Thereby, user""s convenience is afforded.
A file format of the array data save file is defined as means for effectively realizing the first object and as means for effective realization in a plural-process system such as a parallel computer.
To attain the first object, data compressing means for reducing the amount of data of the array data save file by lowering the accuracy in numeric value of an array value may be provided in the data saving means. Thereby, in a large scale array requiring the use of a large amount of a resource such as a disk, the further saving of the resource is possible in the case where no problem is provided even if the display is made with the accuracy in numeric value lowered at an initial stage of debugging, at the time of graph display, and so forth.
To attain the first object, CSV (Comma Separated Valve) format file generating means for converting any array data in the array data save file into CSV format data may be provided in the debugger system. Thereby, the saved array data can be utilized by another application.
The first object can be achieved in accordance with a procedure shown in the following.
(1) Using the debugger system, a user executes a program to be debugged. At this time, a breakpoint is designated to a row of the program to be subjected to sampling.
(2) The program is progressed up to the desired breakpoint. When the program reaches the breakpoint, a data save command is issued with the designation of array data to be saved.
(3) The operation of (2) is also repeated for other breakpoints.
(4) A file in which an array to be displayed is saved is designated in a data display window or by a display command so that the saved array data is displayed on a display unit in the sequence of saving.
(5) When an instruction for outputting the array data of the save file to a CSV format file is made, the saved array data is outputted to the CSV format file which is based on a standard format.
In the present invention, the data saving means and the data displaying means are operated asynchronously with each other. Therefore, no problem is provided even if simultaneous access to the array data save file is made by the data saving means for the writing of data and by the data displaying means for the reading of data. Accordingly, it is possible to perform the operation of (3) on occasion from a point of time of completion of the operation of (2).
The above provides an effect that the reference to array data sampled at a breakpoint before the present breakpoint can be made by the user under program execution and the reference to array data sampled at the time of program execution can be made by the user after program completion.
To attain the second object of the present invention, array constructing means for constructing array data distributed to a plurality of processes and graph displaying means for displaying the constructed array data in the form of a graph are provided in a debugger system. With this construction, the distributed array is automatically constructed into an array before distribution and the constructed array is displayed in the form of a graph, thereby making it possible to shorten a time required for the verification of data.
To attain the second object, language type discriminating means for discriminating the type of a language of a program to be debugged may be provided in the array constructing means. Thereby, the difference in arrangement of an array on a memory depending on the type of the language of the program to be debugged is automatically discriminated so that when the array after construction is displayed in the form of a graph, a user is not required to be conscious of the difference in language.
To attain the second object, the graph displaying means may be provided with shared portion checking means for checking whether or not shared portions between distributional arrays are correct and check result graph displaying means for graphically displaying the result of check by the shared portion checking means. With this construction, whether or not the shared portions between the distributional arrays are correct is checked to detect an abnormality in the whole of the array, thereby making it possible to immediately verify whether or not the performed calculation is correct. Also, a time required for specifying an incorrect location is reduced by displaying the result of check in the form of a graph.
To attain the second object, means for monitoring a program to be debugged may be provided for monitoring the passage of the program through a breakpoint and the updating of a designated array to inform the graph displaying means of the passage and the updating. With this construction, the graph of an array being displayed is automatically updated each time a predesignated breakpoint is passed and each time the designated array is updated. Thus, a change in array is displayed in time series, thereby making it possible to immediately know which point of time was incorrectness generated at.
To attain the second object, the graph displaying means may be provided with display element sampling means by which elements to be subjected to graph display are sampled from array data. With this construction, the graph display is performed in such a manner that if only normal values are included in the range of trimming, a means value thereof is determined and displayed whereas if an abnormal value is included in the range of trimming, the abnormal value is preferentially displayed. Thereby, the graph is displayed at a high speed with data being automatically trimmed without deforming the graph. Therefore, the efficiency of debugging is not lowered even in the case of a large amount of data. Also, it is possible to enlarge the graph partially, thereby reducing a time required for specifying an incorrect location.
To attain the second object, the display element sampling means may be provided with data sampling rule setting means for designating a rule for sampling when the elements to be subjected to graph display are sampled from the array data. With this construction, the designation of a rule for trimming becomes possible and the selection of data trimming conformable to the characteristic of a program to be debugged becomes possible. Thereby, it is possible to remove a harmful influence caused by the trimming of unnecessary data.
The second object can be achieved in accordance with a procedure shown in the following.
(1) Using the debugger system, a user executes a program to be debugged. At this time, a breakpoint is designated to a row of the program to be subjected to graph display.
(2) The program is progressed up to the desired breakpoint. When the program reaches the breakpoint, array data to be subjected to graph display is designated. Then, an array of each process is automatically constructed and the constructed array is displayed in the form of a graph on a display unit.
(3) When the check of portions shared between distributional array data of the respective processes is designated, the result of check of the shared portions between the distributional array data is displayed in the form of a graph on the display unit.
(4) A breakpoint to be subjected to monitoring and an array to be monitored are designated beforehand. Thereby, when the breakpoint is passed or when the array is updated, a graph being displayed on the display unit is updated.
(5) A rule for trimming is designated to change elements which are to be displayed as a graph on the display unit and elements which are not to be displayed.
(6) A graph displayed on the display unit is designated by a pointing unit such as a mouse or an element number is designated, so that array data in the vicinity of the designated element is displayed in an enlarged form.
Thus, a distributed array is automatically constructed and the constructed array is displayed in the form of a graph so that the condition of the array at a designated point of time can be confirmed as a graph. Thereby, the debugging can effectively be performed. Also, since the value of array data is monitored and the graph is updated when the condition of array data changes, it is possible to know that row on a program to be debugged at which the contents of array data are updated, thereby making it possible to effectively perform the debugging. Further, when a large amount of array data including a large number of elements is to be displayed in the form of a graph, the graph display is performed at a high speed with elements trimmed but the displayed graph maintains a form before trimming. Further, since a rule for trimming can be defined, a user""s intended trimming can be performed, thereby making it possible to effectively perform the debugging.